package com.bootdo.system.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.system.dao.RedBagMapper;
import com.bootdo.system.domain.RedBag;
import com.bootdo.system.service.RedBagService;
import com.github.pagehelper.PageHelper;



@Service("redBagService")
public class RedBagServiceImpl implements RedBagService {
	@Autowired
	private RedBagMapper redBagMapper;
	
	@Override
	public RedBag get(Long id){
		return redBagMapper.get(id);
	}
	
	@Override
	public List<RedBag> list(Map<String, Object> map){
		PageHelper.startPage(Integer.parseInt(map.get("pageNum").toString()),Integer.parseInt(map.get("pageSize").toString()));
		return redBagMapper.list(map);
	}
	
	
	@Override
	public List<RedBag> myBagList(Map<String, Object> map){
		PageHelper.startPage(Integer.parseInt(map.get("pageNum").toString()),Integer.parseInt(map.get("pageSize").toString()));
		return redBagMapper.myBagList(map);
	}
	
	@Override
	public RedBag getMaxRedBag(Map<String, Object> map){
		return redBagMapper.getMaxRedBag(map);
	}
	
	
	@Override
	public int count(Map<String, Object> map){
		return redBagMapper.count(map);
	}
	
	@Override
	public int countCanUse(Map<String, Object> map){
		return redBagMapper.countCanUse(map);
	}
	
	
	@Override
	public int save(RedBag bComments){
		return redBagMapper.save(bComments);
	}
	
	@Override
	public int update(RedBag bComments){
		return redBagMapper.update(bComments);
	}
	
	@Override
	public int remove(Long id){
		return redBagMapper.remove(id);
	}
	
	@Override
	public int batchRemove( Integer[] ids){
		return redBagMapper.batchRemove(ids);
	}

}
